package com.freemalll.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.freemalll.system.domain.SysRoleResRel;
import com.freemalll.system.mapper.SysRoleResRelMapper;
import com.freemalll.system.service.ISysRoleResRelService;

/**
 * 角色资源关系 服务层实现
 * 
 * @author freemalll
 */
@Service
public class SysRoleResRelServiceImpl implements ISysRoleResRelService
{
    @Autowired
    private SysRoleResRelMapper roleResRelMapper;

    @Override
    public SysRoleResRel selectRoleResRelById(String id)
    {
        return roleResRelMapper.selectRoleResRelById(id);
    }

    @Override
    public List<SysRoleResRel> selectRoleResRelByRoleId(String roleId)
    {
        return roleResRelMapper.selectRoleResRelByRoleId(roleId);
    }

    @Override
    public List<SysRoleResRel> selectRoleResRelByResourceId(String resourceId)
    {
        return roleResRelMapper.selectRoleResRelByResourceId(resourceId);
    }

    @Override
    public List<SysRoleResRel> selectRoleResRelList(SysRoleResRel roleResRel)
    {
        return roleResRelMapper.selectRoleResRelList(roleResRel);
    }

    @Override
    public int insertRoleResRel(SysRoleResRel roleResRel)
    {
        return roleResRelMapper.insert(roleResRel);
    }

    @Override
    public int updateRoleResRel(SysRoleResRel roleResRel)
    {
        return roleResRelMapper.updateById(roleResRel);
    }

    @Override
    public void deleteRoleResRelByIds(String[] ids)
    {
        for (String id : ids)
        {
            roleResRelMapper.deleteById(id);
        }
    }

    @Override
    public int deleteRoleResRelById(String id)
    {
        return roleResRelMapper.deleteById(id);
    }
}